import React, { useEffect } from 'react';
import { Spin } from 'antd';
import './index.less';
import useRouter from 'components/hooks/useRouter';
import { useRequest } from 'ahooks';
import { checkServer } from 'api/Login';
const LoadingPage = () => {
    const router = useRouter()
    useRequest(checkServer, {
        pollingInterval: 2000,
        onSuccess(res) {
            console.log(res)
            if (res === 'success') {
                router.push('/login')
            }
        },
        onError() {
            console.log('error')
        }
    })
    return (
        <div className="loading-page flex-col">
            <Spin className="mb20"/>
            <div>服务正在启动中...</div>
        </div>
    )
}
export default LoadingPage